package BC55_简单计算器;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            String str = sc.nextLine();
            String[] strings = str.split("[+\\-*/]");
            if (strings.length < 2) {
                System.out.println("Invalid operation!");
            }else {
                String ch1 = str.substring(strings[0].length(), strings[0].length() + 1);
                char ch = ch1.charAt(0);
                double a = Double.parseDouble(strings[0]);
                double b = Double.parseDouble(strings[1]);

                switch (ch) {
                    case '+':
                        System.out.printf("%.4f+%.4f=%.4f\n", a, b, a + b);
                        break;
                    case '-':
                        System.out.printf("%.4f-%.4f=%.4f\n", a, b, a - b);
                        break;
                    case '*':
                        System.out.printf("%.4f*%.4f=%.4f\n", a, b, a * b);
                        break;
                    case '/':
                        if (b == 0) {
                            System.out.println("Wrong!Division by zero!\n");
                        } else {
                            System.out.printf("%.4f/%.4f=%.4f\n", a, b, a / b);
                        }
                        break;
                    default:
                        break;

                }
            }

        }
    }
}
